package interceptor;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 项目名：PAIMSys
 * 包名：interceptor
 * 类名：ErrorExceptionResolver
 * 描述：
 * 作者：柳胜酉
 * 开始时间：2023/4/26
 * 完成时间：
 * 版本：1.0
 */
@ControllerAdvice
public class ErrorExceptionResolver {
    @ExceptionHandler
    public ModelAndView resolveException(
            Exception arg) {
        System.out.println(arg);
        ModelAndView mv = new ModelAndView();
        mv.setViewName("/system/error");
        return mv;
    }
}
